using Game.Const;
using Game.Core;
using Game.Main.Model;
using Game.Main.View;
using Game.Manager;
using Game.XH;
using UnityEngine;

namespace Game.Component
{
	public class GashaponItem : BaseItem
	{
		public override void Init(ItemArchiveData data)
		{
			base.Init(data);
			Transform trans = model.Find("Icon");
			trans.SetLocalZ(1E-05f);
		}

		public override void QuicklyTouch(TouchEventData touchEventData)
		{
			base.QuicklyTouch(touchEventData);
			if (base.itemData.createIds != null)
			{
				BaseItem baseItem = Singleton<Scene>.Instance.ChangeItem(this, base.itemData.createIds[0]);
				if (baseItem != null)
				{
					baseItem.DropDown(base.transform.position, true);
					Singleton<AudioManager>.Instance.PlaySound("sound_explode");
					Singleton<EffectManager>.Instance.ShowEffect(PathConst.EFFECT + "efc_explode_1", baseItem.transform.position + new Vector3(0f, 0f, -0.0004f), 1f);
					Singleton<EffectManager>.Instance.ShowEffect(PathConst.EFFECT + "efc_blink_1", baseItem.transform.position + new Vector3(0f, 0f, -0.0004f), 3f);
				}
			}
			else
			{
				Trace.LogError("物件" + base.itemData.id + "未配置创建物件对象");
			}
		}
	}
}
